namespace Leey.Net.eTerm
{
    using System;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Windows.Forms;

    public class eTermEncode
    {
        private static string aaaa(string str)
        {
            MessageBox.Show(str);
            return (str + "XXXXXXXX");
        }

        private static void copy(byte[] a, byte[] b, int n)
        {
            for (int i = 0; i < n; i++)
            {
                a[i] = b[i];
            }
        }

        private static unsafe void copy(byte[] a, byte* b, int n)
        {
            for (int i = 0; i < n; i++)
            {
                b++;
                a[i] = b[0];
            }
        }

        private static unsafe void copy(byte* a, byte[] b, int n)
        {
            for (int i = 0; i < n; i++)
            {
                a++;
                a[0] = b[i];
            }
        }

        public static byte[] DecodeGB2312(byte[] a)
        {
            for (int i = 0; i <= (a.Length - 2); i++)
            {
                if ((a[i] == 0x1b) && (a[i + 1] == 14))
                {
                    a[i] = 0x20;
                    a[i + 1] = 0x20;
                    i += 2;
                    while ((i < (a.Length - 1)) && ((a[i] != 0x1b) || (a[i + 1] != 15)))
                    {
                        if ((a[i] <= 40) && (a[i] >= 0x25))
                        {
                            int num2 = a[i];
                            a[i] = a[i + 1];
                            a[i + 1] = (byte) num2;
                            if (a[i] > 50)
                            {
                                a[i] = (byte) (a[i] - 14);
                            }
                            if (i < (a.Length - 1))
                            {
                                a[i + 1] = (byte) ((a[i + 1] + 10) + 0x80);
                            }
                        }
                        else
                        {
                            if (a[i] > 50)
                            {
                                a[i] = (byte) (a[i] - 14);
                            }
                            if (i < (a.Length - 1))
                            {
                                a[i + 1] = (byte) (a[i + 1] + 0x80);
                            }
                        }
                        a[i] = (byte) (a[i] + 0x8e);
                        i += 2;
                    }
                    a[i] = 0x20;
                    if (i < (a.Length - 1))
                    {
                        a[i + 1] = 0x20;
                    }
                }
            }
            return a;
        }

        public static string EncodeCmdString(string cmdstring)
        {
            MatchEvaluator evaluator = new MatchEvaluator(eTermEncode.ReplaceCC);
            return Regex.Replace(cmdstring, "([一-龥]{1,})", evaluator);
        }

        public static byte[] EncodeGB2312(byte[] strInput)
        {
            byte[] buffer = strInput;
            for (int i = 0; i <= ((buffer.Length / 2) - 1); i++)
            {
                buffer[i * 2] = (byte) (buffer[i * 2] - 0x8e);
                if (buffer[i * 2] > 0x24)
                {
                    buffer[i * 2] = (byte) (buffer[i * 2] + 14);
                }
                buffer[(i * 2) + 1] = (byte) (buffer[(i * 2) + 1] - 0x80);
                if ((buffer[(i * 2) + 1] >= 0x2f) && (buffer[(i * 2) + 1] <= 50))
                {
                    buffer[(i * 2) + 1] = (byte) (buffer[(i * 2) + 1] - 10);
                    int num2 = buffer[i * 2];
                    buffer[i * 2] = buffer[(i * 2) + 1];
                    buffer[(i * 2) + 1] = (byte) num2;
                }
            }
            byte[] array = new byte[buffer.Length + 4];
            array[0] = 0x1b;
            array[1] = 14;
            buffer.CopyTo(array, 2);
            array[buffer.Length + 2] = 0x1b;
            array[buffer.Length + 3] = 15;
            return array;
        }

        public static string EncodeGB2312(string strInput)
        {
            byte[] bytes = Encoding.Default.GetBytes(strInput);
            for (int i = 0; i <= ((bytes.Length / 2) - 1); i++)
            {
                bytes[i * 2] = (byte) (bytes[i * 2] - 0x8e);
                if (bytes[i * 2] > 0x24)
                {
                    bytes[i * 2] = (byte) (bytes[i * 2] + 14);
                }
                bytes[(i * 2) + 1] = (byte) (bytes[(i * 2) + 1] - 0x80);
                if ((bytes[(i * 2) + 1] >= 0x2f) && (bytes[(i * 2) + 1] <= 50))
                {
                    bytes[(i * 2) + 1] = (byte) (bytes[(i * 2) + 1] - 10);
                    int num2 = bytes[i * 2];
                    bytes[i * 2] = bytes[(i * 2) + 1];
                    bytes[(i * 2) + 1] = (byte) num2;
                }
            }
            byte[] array = new byte[bytes.Length + 4];
            array[0] = 0x1b;
            array[1] = 14;
            bytes.CopyTo(array, 2);
            array[bytes.Length + 2] = 0x1b;
            array[bytes.Length + 3] = 15;
            return Encoding.Default.GetString(array);
        }

        internal static unsafe void Encropy(byte[] a, byte[] b)
        {
            byte[] buffer = new byte[0x80];
            byte[] buffer2 = new byte[8];
            byte[] c = Leey.Net.eTerm.Command.StringToBytes("58 B4 C2 24 32 39 6F 2A");
            byte[] buffer4 = new byte[8];
            byte[] buffer5 = new byte[0x80];
            copy(buffer, a, 0x80);
            fixed (byte* numRef = buffer5)
            {
                fixed (byte* numRef2 = buffer)
                {
                    fixed (byte* numRef3 = buffer2)
                    {
                        fixed (byte* numRef4 = buffer4)
                        {
                            int num;
                            buffer2[0] = a[0x36];
                            buffer2[2] = a[12];
                            buffer2[3] = a[0x6d];
                            buffer2[5] = a[0x38];
                            buffer2[7] = a[2];
                            buffer[7] = 0x77;
                            buffer[0x19] = 0x9c;
                            buffer[0x45] = 0x62;
                            buffer[0x63] = 0x1b;
                            buffer[0x73] = 1;
                            buffer[0x7b] = 0x6f;
                            buffer2[1] = 0xc6;
                            buffer2[4] = 12;
                            buffer2[6] = 0x75;
                            sub_004078EE(numRef3, numRef4, c);
                            buffer4[2] = 0x23;
                            buffer4[5] = 0x73;
                            buffer4[6] = 0x34;
                            for (num = 0; num < 0x10; num++)
                            {
                                sub_004078EE(numRef2 + (num * 8), numRef + (num * 8), buffer4);
                                int num2 = (num * 7) + 3;
                                buffer4[2] = Convert.ToByte(num2);
                                buffer4[5] = buffer5[4 + (num * 7)];
                            }
                            byte num3 = 0;
                            byte num4 = 0;
                            num3 = buffer5[0x42];
                            num4 = buffer5[14];
                            buffer5[14] = num3;
                            buffer5[0x42] = num4;
                            num3 = buffer5[0x2d];
                            num4 = buffer5[0x75];
                            buffer5[0x75] = num3;
                            num3 = buffer5[0x63];
                            buffer5[0x2d] = num4;
                            num4 = buffer5[4];
                            buffer5[4] = num3;
                            num3 = buffer5[10];
                            buffer5[0x63] = num4;
                            num4 = buffer5[120];
                            buffer5[120] = num3;
                            num3 = buffer5[0x15];
                            buffer5[10] = num4;
                            num4 = buffer5[0x51];
                            buffer5[0x51] = num3;
                            buffer5[0x15] = num4;
                            copy(buffer, buffer5, 0x80);
                            int num5 = 0x550b;
                            for (num = 0; num < 0x80; num++)
                            {
                                num5 += buffer[num];
                            }
                            string str = (num5 % 0x2710).ToString();
                            int num7 = 0;
                            foreach (char ch in str)
                            {
                                buffer5[num7++] = Convert.ToByte(ch);
                            }
                            num3 = buffer5[0];
                            buffer4[1] = num3;
                            num3 = buffer5[1];
                            buffer4[2] = num3;
                            num3 = buffer5[2];
                            buffer4[3] = num3;
                            num3 = buffer5[3];
                            buffer4[0] = 0x26;
                            buffer4[4] = 0x54;
                            buffer4[5] = 0x79;
                            buffer4[6] = num3;
                            buffer4[7] = 0x40;
                            for (num = 0; num < 0x10; num++)
                            {
                                sub_004078EE(numRef2 + (num * 8), numRef + (num * 8), buffer4);
                            }
                            copy(b, numRef, 0x80);
                        }
                    }
                }
            }
            //numRef3 = null;
            //numRef4 = null;
        }

        private static string GetPinYin(string StrInput)
        {
            string s = "02 10 0F 10 18 10 1B 10 24 10 36 10 3E 10 4D 10 59 10 0C 11 1B 11 1F 11 25 11 3D 11 49 11 4D 11 51 11 57 11 02 12 15 12 20 12 21 12 2C 12 33 12 38 12 3D 12 42 12 00 00 44 12 4F 12 52 12 5C 12 0B 13 14 13 1A 13 24 13 33 13 43 13 48 13 54 13 06 14 07 14 0E 14 14 14 19 14 20 14 22 14 2E 14 34 14 35 14 39 14 3C 14 44 14 47 14 4D 14 53 14 01 15 10 15 15 15 21 15 24 15 2B 15 3E 15 00 00 4E 15 57 15 5E 15 09 16 0A 16 14 16 1C 16 2A 16 30 16 34 16 3D 16 49 16 56 16 57 16 01 17 09 17 1A 17 25 17 31 17 40 17 4F 17 50 17 51 17 20 18 22 18 28 18 33 18 3C 18 46 18 57 18 58 18 5A 18 03 19 12 19 1B 19 2D 19 33 19 36 19 41 19 44 19 54 19 57 19 5D 19 5E 19 07 1A 1A 1A 1D 1A 26 1A 38 1A 3A 1A 3E 1A 43 1A 4C 1A 53 1A 07 1B 10 1B 15 1B 23 1B 31 1B 46 1B 4C 1B 56 1B 2D 1C 3E 1C 08 1D 15 1D 31 1D 4C 1D 02 1E 1B 1E 1D 1E 2E 1E 47 1E 4E 1E 58 1E 05 1F 00 00 09 1F 0E 1F 14 1F 1B 1F 1F 1F 2E 1F 32 1F 34 1F 38 1F 3C 1F 43 1F 48 1F 4C 1F 4E 1F 56 1F 03 20 07 20 0B 20 12 20 15 20 24 20 2B 20 34 20 36 20 41 20 44 20 08 21 09 21 17 21 22 21 2F 21 34 21 3F 21 4E 21 59 21 04 22 0A 22 1E 22 2C 22 32 22 34 22 3B 22 47 22 50 22 56 22 01 23 07 23 13 23 14 23 24 23 27 23 2F 23 3D 23 46 23 4E 23 50 23 56 23 5C 23 5D 23 10 24 13 24 22 24 29 24 2E 24 31 24 32 24 37 24 38 24 3A 24 3B 24 3C 24 47 24 4E 24 50 24 52 24 59 24 5A 24 02 25 06 25 0A 25 00 00 0D 25 0E 25 0F 25 11 25 15 25 16 25 1D 25 23 25 29 25 31 25 36 25 3D 25 46 25 48 25 56 25 09 26 0D 26 11 26 13 26 18 26 21 26 29 26 2A 26 39 26 5D 26 02 27 18 27 20 27 2F 27 34 27 3F 27 4C 27 4E 27 56 27 05 28 10 28 18 28 1A 28 1E 28 23 28 26 28 28 28 32 28 34 28 35 28 3F 28 42 28 4C 28 4E 28 51 28 53 28 55 28 58 28 5C 28 02 29 05 29 09 29 0C 29 0D 29 0E 29 17 29 19 29 29 29 31 29 3C 29 48 29 58 29 05 2A 34 2A 3E 2A 01 2B 03 2B 07 2B 09 2B 0C 2B 10 2B 14 2B 18 2B 28 2B 30 2B 34 2B 40 2B 43 2B 4E 2B 51 2B 59 2B 04 2C 0D 2C 1F 2C 2C 2C 37 2C 38 2C 3C 2C 4B 2C 53 2C 58 2C 5B 2C 07 2D 14 2D 18 2D 23 2D 25 2D 2B 2D 2E 2D 39 2D 40 2D 42 2D 53 2D 5D 2D 20 2E 2A 2E 2D 2E 36 2E 53 2E 18 2F 25 2F 3F 2F 53 2F 07 30 1C 30 26 30 35 30 3C 30 45 30 58 30 04 31 0A 31 18 31 28 31 49 31 5A 31 0B 32 1A 32 4F 32 01 33 13 33 14 33 23 33 37 33 06 34 1A 34 24 34 30 34 33 34 3A 34 3E 34 41 34 4F 34 53 34 54 34 55 34 59 34 09 35 0F 35 20 35 2F 35 39 35 43 35 53 35 04 36 2F 36 3A 36 48 36 04 37 06 37 07 37 0D 37 15 37 1A 37 1C 37 27 37 36 37 3D 37 41 37 49 37 4B 37 4F 37 51 37 59 37";
            string str2 = "61 20 20 20 20 20 20 61 69 20 20 20 20 20 61 6E 20 20 20 20 20 61 6E 67 20 20 20 20 61 6F 20 20 20 20 20 62 61 20 20 20 20 20 62 61 69 20 20 20 20 62 61 6E 20 20 20 20 62 61 6E 67 20 20 20 62 61 6F 20 20 20 20 62 65 69 20 20 20 20 62 65 6E 20 20 20 20 62 65 6E 67 20 20 20 62 69 20 20 20 20 20 62 69 61 6E 20 20 20 62 69 61 6F 20 20 20 62 69 65 20 20 20 20 62 69 6E 20 20 20 20 62 69 6E 67 20 20 20 62 6F 20 20 20 20 20 62 75 20 20 20 20 20 63 61 20 20 20 20 20 63 61 69 20 20 20 20 63 61 6E 20 20 20 20 63 61 6E 67 20 20 20 63 61 6F 20 20 20 20 63 65 20 20 20 20 20 63 65 6E 20 20 20 20 63 65 6E 67 20 20 20 63 68 61 20 20 20 20 63 68 61 69 20 20 20 63 68 61 6E 20 20 20 63 68 61 6E 67 20 20 63 68 61 6F 20 20 20 63 68 65 20 20 20 20 63 68 65 6E 20 20 20 63 68 65 6E 67 20 20 63 68 69 20 20 20 20 63 68 6F 6E 67 20 20 63 68 6F 75 20 20 20 63 68 75 20 20 20 20 63 68 75 61 69 20 20 63 68 75 61 6E 20 20 63 68 75 61 6E 67 20 63 68 75 69 20 20 20 63 68 75 6E 20 20 20 63 68 75 6F 20 20 20 63 69 20 20 20 20 20 63 6F 6E 67 20 20 20 63 6F 75 20 20 20 20 63 75 20 20 20 20 20 63 75 61 6E 20 20 20 63 75 69 20 20 20 20 63 75 6E 20 20 20 20 63 75 6F 20 20 20 20 64 61 20 20 20 20 20 64 61 69 20 20 20 20 64 61 6E 20 20 20 20 64 61 6E 67 20 20 20 64 61 6F 20 20 20 20 64 65 20 20 20 20 20 64 65 6E 67 20 20 20 64 69 20 20 20 20 20 64 69 61 20 20 20 20 64 69 61 6E 20 20 20 64 69 61 6F 20 20 20 64 69 65 20 20 20 20 64 69 6E 67 20 20 20 64 69 75 20 20 20 20 64 6F 6E 67 20 20 20 64 6F 75 20 20 20 20 64 75 20 20 20 20 20 64 75 61 6E 20 20 20 64 75 69 20 20 20 20 64 75 6E 20 20 20 20 64 75 6F 20 20 20 20 65 20 20 20 20 20 20 65 6E 20 20 20 20 20 65 72 20 20 20 20 20 66 61 20 20 20 20 20 66 61 6E 20 20 20 20 66 61 6E 67 20 20 20 66 65 69 20 20 20 20 66 65 6E 20 20 20 20 66 65 6E 67 20 20 20 66 6F 20 20 20 20 20 66 6F 75 20 20 20 20 66 75 20 20 20 20 20 67 61 20 20 20 20 20 67 61 69 20 20 20 20 67 61 6E 20 20 20 20 67 61 6E 67 20 20 20 67 61 6F 20 20 20 20 67 65 20 20 20 20 20 67 65 69 20 20 20 20 67 65 6E 20 20 20 20 67 65 6E 67 20 20 20 67 6F 6E 67 20 20 20 67 6F 75 20 20 20 20 67 75 20 20 20 20 20 67 75 61 20 20 20 20 67 75 61 69 20 20 20 67 75 61 6E 20 20 20 67 75 61 6E 67 20 20 67 75 69 20 20 20 20 67 75 6E 20 20 20 20 67 75 6F 20 20 20 20 68 61 20 20 20 20 20 68 61 69 20 20 20 20 68 61 6E 20 20 20 20 68 61 6E 67 20 20 20 68 61 6F 20 20 20 20 68 65 20 20 20 20 20 68 65 69 20 20 20 20 68 65 6E 20 20 20 20 68 65 6E 67 20 20 20 68 6F 6E 67 20 20 20 68 6F 75 20 20 20 20 68 75 20 20 20 20 20 68 75 61 20 20 20 20 68 75 61 69 20 20 20 68 75 61 6E 20 20 20 68 75 61 6E 67 20 20 68 75 69 20 20 20 20 68 75 6E 20 20 20 20 68 75 6F 20 20 20 20 6A 69 20 20 20 20 20 6A 69 61 20 20 20 20 6A 69 61 6E 20 20 20 6A 69 61 6E 67 20 20 6A 69 61 6F 20 20 20 6A 69 65 20 20 20 20 6A 69 6E 20 20 20 20 6A 69 6E 67 20 20 20 6A 69 6F 6E 67 20 20 6A 69 75 20 20 20 20 6A 75 20 20 20 20 20 6A 75 61 6E 20 20 20 6A 75 65 20 20 20 20 6A 75 6E 20 20 20 20 6A 76 20 20 20 20 20 6B 61 20 20 20 20 20 6B 61 69 20 20 20 20 6B 61 6E 20 20 20 20 6B 61 6E 67 20 20 20 6B 61 6F 20 20 20 20 6B 65 20 20 20 20 20 6B 65 6E 20 20 20 20 6B 65 6E 67 20 20 20 6B 6F 6E 67 20 20 20 6B 6F 75 20 20 20 20 6B 75 20 20 20 20 20 6B 75 61 20 20 20 20 6B 75 61 69 20 20 20 6B 75 61 6E 20 20 20 6B 75 61 6E 67 20 20 6B 75 69 20 20 20 20 6B 75 6E 20 20 20 20 6B 75 6F 20 20 20 20 6C 61 20 20 20 20 20 6C 61 69 20 20 20 20 6C 61 6E 20 20 20 20 6C 61 6E 67 20 20 20 6C 61 6F 20 20 20 20 6C 65 20 20 20 20 20 6C 65 69 20 20 20 20 6C 65 6E 67 20 20 20 6C 69 20 20 20 20 20 6C 69 61 20 20 20 20 6C 69 61 6E 20 20 20 6C 69 61 6E 67 20 20 6C 69 61 6F 20 20 20 6C 69 65 20 20 20 20 6C 69 6E 20 20 20 20 6C 69 6E 67 20 20 20 6C 69 75 20 20 20 20 6C 6F 6E 67 20 20 20 6C 6F 75 20 20 20 20 6C 75 20 20 20 20 20 6C 76 20 20 20 20 20 6C 75 61 6E 20 20 20 6C 75 65 20 20 20 20 6C 75 6E 20 20 20 20 6C 75 6F 20 20 20 20 6D 61 20 20 20 20 20 6D 61 69 20 20 20 20 6D 61 6E 20 20 20 20 6D 61 6E 67 20 20 20 6D 61 6F 20 20 20 20 6D 65 20 20 20 20 20 6D 65 69 20 20 20 20 6D 65 6E 20 20 20 20 6D 65 6E 67 20 20 20 6D 69 20 20 20 20 20 6D 69 61 6E 20 20 20 6D 69 61 6F 20 20 20 6D 69 65 20 20 20 20 6D 69 6E 20 20 20 20 6D 69 6E 67 20 20 20 6D 69 75 20 20 20 20 6D 6F 20 20 20 20 20 6D 6F 75 20 20 20 20 6D 75 20 20 20 20 20 6E 61 20 20 20 20 20 6E 61 69 20 20 20 20 6E 61 6E 20 20 20 20 6E 61 6E 67 20 20 20 6E 61 6F 20 20 20 20 6E 65 20 20 20 20 20 6E 65 69 20 20 20 20 6E 65 6E 20 20 20 20 6E 65 6E 67 20 20 20 6E 69 20 20 20 20 20 6E 69 61 6E 20 20 20 6E 69 61 6E 67 20 20 6E 69 61 6F 20 20 20 6E 69 65 20 20 20 20 6E 69 6E 20 20 20 20 6E 69 6E 67 20 20 20 6E 69 75 20 20 20 20 6E 6F 6E 67 20 20 20 6E 6F 75 20 20 20 20 6E 75 20 20 20 20 20 6E 76 20 20 20 20 20 6E 75 61 6E 20 20 20 6E 75 65 20 20 20 20 6E 75 6F 20 20 20 20 6F 20 20 20 20 20 20 6F 75 20 20 20 20 20 70 61 20 20 20 20 20 70 61 69 20 20 20 20 70 61 6E 20 20 20 20 70 61 6E 67 20 20 20 70 61 6F 20 20 20 20 70 65 69 20 20 20 20 70 65 6E 20 20 20 20 70 65 6E 67 20 20 20 70 69 20 20 20 20 20 70 69 61 6E 20 20 20 70 69 61 6F 20 20 20 70 69 65 20 20 20 20 70 69 6E 20 20 20 20 70 69 6E 67 20 20 20 70 6F 20 20 20 20 20 70 6F 75 20 20 20 20 70 75 20 20 20 20 20 71 69 20 20 20 20 20 71 69 61 20 20 20 20 71 69 61 6E 20 20 20 71 69 61 6E 67 20 20 71 69 61 6F 20 20 20 71 69 65 20 20 20 20 71 69 6E 20 20 20 20 71 69 6E 67 20 20 20 71 69 6F 6E 67 20 20 71 69 75 20 20 20 20 71 75 20 20 20 20 20 71 75 61 6E 20 20 20 71 75 65 20 20 20 20 71 75 6E 20 20 20 20 72 61 6E 20 20 20 20 72 61 6E 67 20 20 20 72 61 6F 20 20 20 20 72 65 20 20 20 20 20 72 65 6E 20 20 20 20 72 65 6E 67 20 20 20 72 69 20 20 20 20 20 72 6F 6E 67 20 20 20 72 6F 75 20 20 20 20 72 75 20 20 20 20 20 72 75 61 6E 20 20 20 72 75 69 20 20 20 20 72 75 6E 20 20 20 20 72 75 6F 20 20 20 20 73 61 20 20 20 20 20 73 61 69 20 20 20 20 73 61 6E 20 20 20 20 73 61 6E 67 20 20 20 73 61 6F 20 20 20 20 73 65 20 20 20 20 20 73 65 6E 20 20 20 20 73 65 6E 67 20 20 20 73 68 61 20 20 20 20 73 68 61 69 20 20 20 73 68 61 6E 20 20 20 73 68 61 6E 67 20 20 73 68 61 6F 20 20 20 73 68 65 20 20 20 20 73 68 65 6E 20 20 20 73 68 65 6E 67 20 20 73 68 69 20 20 20 20 73 68 6F 75 20 20 20 73 68 75 20 20 20 20 73 68 75 61 20 20 20 73 68 75 61 69 20 20 73 68 75 61 6E 20 20 73 68 75 61 6E 67 20 73 68 75 69 20 20 20 73 68 75 6E 20 20 20 73 68 75 6F 20 20 20 73 69 20 20 20 20 20 73 6F 6E 67 20 20 20 73 6F 75 20 20 20 20 73 75 20 20 20 20 20 73 75 61 6E 20 20 20 73 75 69 20 20 20 20 73 75 6E 20 20 20 20 73 75 6F 20 20 20 20 74 61 20 20 20 20 20 74 61 69 20 20 20 20 74 61 6E 20 20 20 20 74 61 6E 67 20 20 20 74 61 6F 20 20 20 20 74 65 20 20 20 20 20 74 65 6E 67 20 20 20 74 69 20 20 20 20 20 74 69 61 6E 20 20 20 74 69 61 6F 20 20 20 74 69 65 20 20 20 20 74 69 6E 67 20 20 20 74 6F 6E 67 20 20 20 74 6F 75 20 20 20 20 74 75 20 20 20 20 20 74 75 61 6E 20 20 20 74 75 69 20 20 20 20 74 75 6E 20 20 20 20 74 75 6F 20 20 20 20 77 61 20 20 20 20 20 77 61 69 20 20 20 20 77 61 6E 20 20 20 20 77 61 6E 67 20 20 20 77 65 69 20 20 20 20 77 65 6E 20 20 20 20 77 65 6E 67 20 20 20 77 6F 20 20 20 20 20 77 75 20 20 20 20 20 78 69 20 20 20 20 20 78 69 61 20 20 20 20 78 69 61 6E 20 20 20 78 69 61 6E 67 20 20 78 69 61 6F 20 20 20 78 69 65 20 20 20 20 78 69 6E 20 20 20 20 78 69 6E 67 20 20 20 78 69 6F 6E 67 20 20 78 69 75 20 20 20 20 78 75 20 20 20 20 20 78 75 61 6E 20 20 20 78 75 65 20 20 20 20 78 75 6E 20 20 20 20 79 61 20 20 20 20 20 79 61 6E 20 20 20 20 79 61 6E 67 20 20 20 79 61 6F 20 20 20 20 79 65 20 20 20 20 20 79 69 20 20 20 20 20 79 69 6E 20 20 20 20 79 69 6E 67 20 20 20 79 6F 20 20 20 20 20 79 6F 6E 67 20 20 20 79 6F 75 20 20 20 20 79 75 20 20 20 20 20 79 75 61 6E 20 20 20 79 75 65 20 20 20 20 79 75 6E 20 20 20 20 7A 61 20 20 20 20 20 7A 61 69 20 20 20 20 7A 61 6E 20 20 20 20 7A 61 6E 67 20 20 20 7A 61 6F 20 20 20 20 7A 65 20 20 20 20 20 7A 65 69 20 20 20 20 7A 65 6E 20 20 20 20 7A 65 6E 67 20 20 20 7A 68 61 20 20 20 20 7A 68 61 69 20 20 20 7A 68 61 6E 20 20 20 7A 68 61 6E 67 20 20 7A 68 61 6F 20 20 20 7A 68 65 20 20 20 20 7A 68 65 6E 20 20 20 7A 68 65 6E 67 20 20 7A 68 69 20 20 20 20 7A 68 6F 6E 67 20 20 7A 68 6F 75 20 20 20 7A 68 75 20 20 20 20 7A 68 75 61 20 20 20 7A 68 75 61 69 20 20 7A 68 75 61 6E 20 20 7A 68 75 61 6E 67 20 7A 68 75 69 20 20 20 7A 68 75 6E 20 20 20 7A 68 75 6F 20 20 20 7A 69 20 20 20 20 20 7A 6F 6E 67 20 20 20 7A 6F 75 20 20 20 20 7A 75 20 20 20 20 20 7A 75 61 6E 20 20 20 7A 75 69 20 20 20 20 7A 75 6E 20 20 20 20 7A 75 6F 20 20 20 20";
            string str3 = "01 10 03 10 10 10 19 10 1C 10 25 10 37 10 3F 10 4E 10 5A 10 0D 11 1C 11 20 11 26 11 3E 11 4A 11 4E 11 52 11 58 11 03 12 16 12 21 12 22 12 2D 12 34 12 39 12 3E 12 00 00 43 12 45 12 50 12 53 12 5D 12 0C 13 15 13 1B 13 25 13 34 13 44 13 49 13 55 13 07 14 08 14 0F 14 15 14 1A 14 21 14 23 14 2F 14 35 14 36 14 3A 14 3D 14 45 14 48 14 4E 14 54 14 02 15 11 15 16 15 22 15 25 15 2C 15 00 00 3F 15 4F 15 58 15 01 16 0A 16 0B 16 15 16 1D 16 2B 16 31 16 35 16 3E 16 4A 16 57 16 58 16 02 17 0A 17 1B 17 26 17 32 17 41 17 50 17 51 17 52 17 21 18 23 18 29 18 34 18 3D 18 47 18 58 18 59 18 5B 18 04 19 13 19 1C 19 2E 19 34 19 37 19 42 19 45 19 55 19 58 19 5E 19 01 1A 08 1A 1B 1A 1E 1A 27 1A 39 1A 3B 1A 3F 1A 44 1A 4D 1A 54 1A 08 1B 11 1B 16 1B 24 1B 32 1B 47 1B 4D 1B 57 1B 2E 1C 3F 1C 09 1D 16 1D 32 1D 4D 1D 03 1E 1C 1E 1E 1E 2F 1E 48 1E 4F 1E 59 1E 00 00 06 1F 0A 1F 0F 1F 15 1F 1C 1F 20 1F 2F 1F 33 1F 35 1F 39 1F 3D 1F 44 1F 49 1F 4D 1F 4F 1F 57 1F 04 20 08 20 0C 20 13 20 16 20 25 20 2C 20 35 20 37 20 42 20 45 20 09 21 0A 21 18 21 23 21 30 21 35 21 40 21 4F 21 5A 21 05 22 0B 22 1F 22 2D 22 33 22 35 22 3C 22 48 22 51 22 57 22 02 23 08 23 14 23 15 23 25 23 28 23 30 23 3E 23 47 23 4F 23 51 23 57 23 5D 23 5E 23 11 24 14 24 23 24 2A 24 2F 24 32 24 33 24 38 24 39 24 3B 24 3C 24 3D 24 48 24 4F 24 51 24 53 24 5A 24 5B 24 03 25 07 25 00 00 0B 25 0E 25 0F 25 10 25 12 25 16 25 17 25 1E 25 24 25 2A 25 32 25 37 25 3E 25 47 25 49 25 57 25 0A 26 0E 26 12 26 14 26 19 26 22 26 2A 26 2B 26 3A 26 5E 26 03 27 19 27 21 27 30 27 35 27 40 27 4D 27 4F 27 57 27 06 28 11 28 19 28 1B 28 1F 28 24 28 27 28 29 28 33 28 35 28 36 28 40 28 43 28 4D 28 4F 28 52 28 54 28 56 28 59 28 5D 28 03 29 06 29 0A 29 0D 29 0E 29 0F 29 18 29 1A 29 2A 29 32 29 3D 29 49 29 59 29 06 2A 35 2A 3F 2A 02 2B 04 2B 08 2B 0A 2B 0D 2B 11 2B 15 2B 19 2B 29 2B 31 2B 35 2B 41 2B 44 2B 4F 2B 52 2B 5A 2B 05 2C 0E 2C 20 2C 2D 2C 38 2C 39 2C 3D 2C 4C 2C 54 2C 59 2C 5C 2C 08 2D 15 2D 19 2D 24 2D 26 2D 2C 2D 2F 2D 3A 2D 41 2D 43 2D 54 2D 5E 2D 21 2E 2B 2E 2E 2E 37 2E 54 2E 19 2F 26 2F 40 2F 54 2F 08 30 1D 30 27 30 36 30 3D 30 46 30 59 30 05 31 0B 31 19 31 29 31 4A 31 5B 31 0C 32 1B 32 50 32 02 33 14 33 15 33 24 33 38 33 07 34 1B 34 25 34 31 34 34 34 3B 34 3F 34 42 34 50 34 54 34 55 34 56 34 5A 34 0A 35 10 35 21 35 30 35 3A 35 44 35 54 35 05 36 30 36 3B 36 49 36 05 37 07 37 08 37 0E 37 16 37 1B 37 1D 37 28 37 37 37 3E 37 42 37 4A 37 4C 37 50 37 52 37 02 10 0F 10 18 10 1B 10 24 10 36 10 3E 10 4D 10 59 10 0C 11 1B 11 1F 11 25 11 3D 11 49 11 4D 11 51 11 57 11 02 12 15 12 20 12 21 12 2C 12 33 12 38 12 3D 12 42 12 00 00 44 12 4F 12 52 12 5C 12 0B 13 14 13 1A 13 24 13 33 13 43 13 48 13 54 13 06 14 07 14 0E 14 14 14 19 14 20 14 22 14 2E 14 34 14 35 14 39 14 3C 14 44 14 47 14 4D 14 53 14 01 15 10 15 15 15 21 15 24 15 2B 15 3E 15 00 00 4E 15 57 15 5E 15 09 16 0A 16 14 16 1C 16 2A 16 30 16 34 16 3D 16 49 16 56 16 57 16 01 17 09 17 1A 17 25 17 31 17 40 17 4F 17 50 17 51 17 20 18 22 18 28 18 33 18 3C 18 46 18 57 18 58 18 5A 18 03 19 12 19 1B 19 2D 19 33 19 36 19 41 19 44 19 54 19 57 19 5D 19 5E 19 07 1A 1A 1A 1D 1A 26 1A 38 1A 3A 1A 3E 1A 43 1A 4C 1A 53 1A 07 1B 10 1B 15 1B 23 1B 31 1B 46 1B 4C 1B 56 1B 2D 1C 3E 1C 08 1D 15 1D 31 1D 4C 1D 02 1E 1B 1E 1D 1E 2E 1E 47 1E 4E 1E 58 1E 05 1F 00 00 09 1F 0E 1F 14 1F 1B 1F 1F 1F 2E 1F 32 1F 34 1F 38 1F 3C 1F 43 1F 48 1F 4C 1F 4E 1F 56 1F 03 20 07 20 0B 20 12 20 15 20 24 20 2B 20 34 20 36 20 41 20 44 20 08 21 09 21 17 21 22 21 2F 21 34 21 3F 21 4E 21 59 21 04 22 0A 22 1E 22 2C 22 32 22 34 22 3B 22 47 22 50 22 56 22 01 23 07 23 13 23 14 23 24 23 27 23 2F 23 3D 23 46 23 4E 23 50 23 56 23 5C 23 5D 23 10 24 13 24 22 24 29 24 2E 24 31 24 32 24 37 24 38 24 3A 24 3B 24 3C 24 47 24 4E 24 50 24 52 24 59 24 5A 24 02 25 06 25 0A 25 00 00 0D 25 0E 25 0F 25 11 25 15 25 16 25 1D 25 23 25 29 25 31 25 36 25 3D 25 46 25 48 25 56 25 09 26 0D 26 11 26 13 26 18 26 21 26 29 26 2A 26 39 26 5D 26 02 27 18 27 20 27 2F 27 34 27 3F 27 4C 27 4E 27 56 27 05 28 10 28 18 28 1A 28 1E 28 23 28 26 28 28 28 32 28 34 28 35 28 3F 28 42 28 4C 28 4E 28 51 28 53 28 55 28 58 28 5C 28 02 29 05 29 09 29 0C 29 0D 29 0E 29 17 29 19 29 29 29 31 29 3C 29 48 29 58 29 05 2A 34 2A 3E 2A 01 2B 03 2B 07 2B 09 2B 0C 2B 10 2B 14 2B 18 2B 28 2B 30 2B 34 2B 40 2B 43 2B 4E 2B 51 2B 59 2B 04 2C 0D 2C 1F 2C 2C 2C 37 2C 38 2C 3C 2C 4B 2C 53 2C 58 2C 5B 2C 07 2D 14 2D 18 2D 23 2D 25 2D 2B 2D 2E 2D 39 2D 40 2D 42 2D 53 2D 5D 2D 20 2E 2A 2E 2D 2E 36 2E 53 2E 18 2F 25 2F 3F 2F 53 2F 07 30 1C 30 26 30 35 30 3C 30 45 30 58 30 04 31 0A 31 18 31 28 31 49 31 5A 31 0B 32 1A 32 4F 32 01 33 13 33 14 33 23 33 37 33 06 34 1A 34 24 34 30 34 33 34 3A 34 3E 34 41 34 4F 34 53 34 54 34 55 34 59 34 09 35 0F 35 20 35 2F 35 39 35 43 35 53 35 04 36 2F 36 3A 36 48 36 04 37 06 37 07 37 0D 37 15 37 1A 37 1C 37 27 37 36 37 3D 37 41 37 49 37 4B 37 4F 37 51 37 59 37 29 00 7F 00 50 01 5A 00 D6 00 13 01 EE 00 60 00 25 00 5E 00 D0 00 4D 00 25 01 6A 01 F1 00 0E 00 47 01 62 01 62 01 7F 01 3F 00 57 01 65 01 9D 00 6A 01 5D 00 39 01 41 00 7F 00 CD 00 C5 00 7F 00 F7 00 C2 00 14 00 18 01 64 00 73 01 20 01 37 00 60 01 8B 00 2D 01 63 01 60 01 01 01 F4 00 69 00 9D 00 0F 00 73 01 65 00 69 01 A8 00 64 01 4D 01 86 00 98 00 69 00 8F 00 A0 00 7F 00 1D 01 4A 01 9A 00 F0 00 8B 00 FB 00 7E 00 64 01 41 01 4B 01 3A 00 44 00 7A 01 A5 00 13 01 5E 00 CB 00 09 01 6A 01 EE 00 5F 01 48 01 50 01 21 00 19 00 91 00 82 01 DB 00 8E 00 69 01 43 00 63 00 41 01 47 01 D5 00 59 00 7F 00 4F 00 69 01 99 00 90 00 82 01 64 01 3E 01 1F 00 83 00 DD 00 CA 00 28 00 60 01 A8 00 00 01 A8 00 6A 01 F3 00 68 01 F7 00 55 00 F9 00 12 01 E7 00 89 01 25 01 B8 00 4F 01 0E 00 3C 01 67 00 96 00 8D 00 54 00 60 01 56 01 84 00 4C 01 8B 01 B4 00 38 01 12 00 E3 00 26 00 51 01 86 00 81 00 83 00 88 00 86 01 5C 01 3A 00 41 01 46 01 20 01 F9 00 8D 01 6C 01 34 00 3F 00 51 01 5E 01 75 00 6B 00 20 00 9D 00 0A 00 F6 00 75 00 58 00 58 00 30 01 2D 01 4D 01 60 01 14 00 6A 00 BD 00 56 01 B5 00 F5 00 13 00 66 01 B8 00 A6 00 AB 00 77 00 AD 00 53 01 2E 01 F3 00 80 01 C7 00 60 01 84 00 75 00 1D 01 E5 00 8D 00 D1 00 64 00 71 00 3F 00 7B 01 01 01 64 01 9C 00 A6 00 65 00 84 00 7C 00 21 01 63 00 02 01 7E 01 7D 00 5B 01 FB 00 5D 00 9C 00 4D 00 8C 01 89 01 4C 01 6A 01 21 01 20 00 32 01 24 00 81 00 5D 01 63 01 4D 00 6A 01 5C 01 03 00 3F 00 8A 01 EF 00 C9 00 3B 00 30 01 23 01 C2 00 7C 01 81 00 75 01 FB 00 8B 00 60 01 79 01 24 00 3A 00 85 00 91 01 50 01 F9 00 86 00 08 00 41 00 91 01 0B 00 58 01 5A 00 7F 01 D9 00 8C 01 2D 00 EE 00 4C 01 7B 00 9D 00 51 01 6E 00 FF 00 9C 00 BC 00 50 01 52 00 13 00 EE 00 0B 00 63 01 3F 00 36 01 80 00 7F 01 82 01 9A 00 FC 00 7A 00 6D 01 A8 00 66 01 5D 00 51 01 58 00 EE 00 37 01 60 01 8A 00 60 01 65 01 7A 01 F4 00 1D 01 8C 01 AF 00 55 00 29 00 7A 00 BA 00 01 01 1F 01 71 00 5E 00 C1 00 5B 01 56 01 2F 01 56 01 8B 00 81 00 1D 01 3B 00 21 00 2D 01 0F 00 0C 00 00 01 0C 00 4D 00 50 00 25 01 7F 00 68 01 71 00 4C 01 50 01 5E 00 7D 01 9C 00 EE 00 64 01 A8 00 F7 00 08 00 5B 00 B1 00 41 00 B3 00 23 00 26 00 47 01 D5 00 CB 00 05 00 5F 01 43 00 46 00 8F 00 60 01 1E 01 D0 00 5A 00 65 01 25 00 23 01 6B 00 5E 01 AD 00 6B 01 7F 01 03 00 64 01 0E 00 D6 00 ED 00 43 01 17 01 39 00 98 00 43 00 65 01 A7 00 76 00 5E 00 6B 01 BB 00 68 01 AB 00 26 00 57 01 EE 00 64 01 1A 00 83 00 CD 00 48 00 F9 00 7F 00 4A 01 59 01 F7 00 54 01 58 00 6B 01 6D 01 58 00 7F 00 A8 00 4D 00 8D 00 0E 00 7F 01 10 01 53 01 21 00 31 00 FD 00 50 01 F9 00 F7 00 1D 01 0F 00 DB 00 97 00 64 01 C9 00 5B 00 F1 00 B1 00 06 00 CB 00 8D 00 05 01 FE 00 26 00 58 00 AF 00 D8 00 65 01 BD 00 66 01 FF 00 C6 00 1F 01 F9 00 3C 01 07 01 0E 00 30 00 8D 00 41 01 7C 00 82 01 40 01 FB 00 58 00 09 01 58 01 02 01 7C 00 5E 01 C7 00 7F 00 83 00 27 00 82 00 B8 00 58 01 F9 00 60 00 85 00 BA 00 33 01 75 00 81 01 90 00 0E 00 23 01 4F 01 69 01 4D 00 BF 00 69 01 A8 00 43 01 53 01 58 00 32 01 69 01 3F 00 21 01 67 00 AB 00 66 01 2E 00 86 00 F7 00 51 01 2E 01 85 00 CD 00 F7 00 06 00 25 01 21 00 3F 01 6A 01 7A 00 0E 00 58 00 43 01 3A 00 35 00 60 01 8D 01 3B 00 81 00 4A 01 66 01 64 00 6E 00 F8 00 55 00 09 01 54 01 4C 01 20 00 8F 00 F7 00 9D 00 51 01 4D 00 0A 00 E6 00 40 01 B2 00 E7 00 5C 01 80 00 7D 01 23 01 0E 01 C9 00 4E 00 0B 00 4E 01 70 00 7F 00 A8 00 09 00 81 00 2C 01 A3 00 66 01 6A 01 30 01 C1 00 47 00 51 01 AA 00 33 00 AE 00 01 01 97 00 5B 01 AC 00 7C 00 5E 01 8B 00 10 01 8F 01 7F 00 C1 00 51 00 F7 00 75 00 56 01 75 00 4C 01 64 01 4E 01 2F 01 0E 00 70 00 36 01 0E 01 5E 01 53 01 5D 00 A8 00 7E 00 01 01 74 00 51 00 D9 00 C2 00 DD 00 64 01 9C 00 AA 00 38 00 64 01 51 01 71 01 EA 00 4B 01 AC 00 59 00 5B 00 3C 01 C0 00 44 01 24 00 58 00 F2 00 05 00 84 00 83 00 70 01 64 01 B4 00 8C 00 3D 01 63 01 02 00 CC 00 7F 00 6B 00 07 00 8D 00 F5 00 AD 00 F9 00 67 00 43 00 77 01 5F 01 FD 00 6A 01 03 00 5C 01 13 00 9D 00 6B 01 25 01 4E 00 2A 00 81 00 2C 01 79 01 E3 00 16 01 B8 00 66 01 7F 01 6E 00 7C 01 56 01 B3 00 90 01 34 00 5B 00 7A 00 EE 00 58 01 89 01 7E 00 8E 01 CF 00 64 01 45 01 39 00 23 01 15 00 26 00 7F 00 97 00 3C 00 A5 00 77 01 01 00 62 01 58 00 CB 00 64 01 39 00 A8 00 4D 00 0E 00 0B 00 6B 00 FD 00 65 01 6E 01 8E 00 52 01 65 00 AF 00 46 00 DB 00 4C 00 D0 00 69 01 2D 01 9C 00 7F 00 21 01 7C 00 38 00 AD 00 64 01 55 01 0E 00 30 00 68 00 7C 00 5A 01 64 01 E7 00 9A 00 4C 00 7F 00 C5 00 C2 00 77 01 DD 00 60 00 CA 00 B9 00 26 00 A4 00 61 00 50 01 77 01 34 01 72 01 51 01 91 01 7F 00 55 00 73 01 E3 00 C4 00 AE 00 85 01 81 01 39 01 77 00 35 00 1B 01 67 01 3A 00 14 00 44 00 A3 00 A8 00 26 01 2F 00 43 00 38 00 CE 00 A8 00 9D 00 84 00 68 01 9D 00 88 00 2F 01 65 01 26 00 8B 00 B2 00 98 00 E4 00 7C 00 FD 00 05 00 30 01 48 00 93 00 D9 00 71 00 24 00 34 01 5E 00 01 00 4E 00 70 00 40 00 02 00 02 00 34 01 72 00 41 01 26 00 EB 00 A6 00 1A 00 F0 00 F7 00 66 01 0D 00 2F 01 3F 00 C2 00 ED 00 8B 00 AC 00 F6 00 2A 00 83 00 E4 00 FD 00 B3 00 1D 00 3E 00 70 00 85 00 8B 00 64 01 14 01 EE 00 0E 01 16 00 7E 00 CF 00 4C 01 81 00 CE 00 B7 00 77 00 AF 00 69 01 6A 01 FE 00 6A 01 7A 00 4C 01 7F 01 EB 00 38 01 28 00 73 01 6B 00 4C 01 4F 01 BB 00 7A 01 58 00 51 00 7F 00 F7 00 F9 00 F7 00 01 01 5F 01 53 01 05 00 1C 00 A2 00 06 00 77 00 93 00 46 00 80 00 5A 01 39 00 63 00 BD 00 C6 00 64 01 46 00 83 00 5E 01 7E 01 A4 00 A1 00 2E 01 60 01 64 00 55 01 6B 00 96 00 8B 00 0C 01 62 01 4C 01 6F 01 4C 01 6A 01 37 00 B2 00 8A 01 BF 00 22 01 2E 01 7F 00 7A 01 AE 00 3E 00 12 00 64 01 41 00 26 00 52 00 33 00 5E 01 61 01 76 00 A1 00 51 01 21 00 7B 00 62 01 7F 01 83 00 01 01 15 01 51 00 00 01 03 00 68 00 B9 00 DC 00 6D 01 52 01 EA 00 53 00 0C 01 9A 00 24 01 33 01 0E 00 8A 00 A8 00 6A 01 53 01 65 01 31 01 64 01 6B 00 B8 00 D5 00 20 01 33 00 C2 00 77 00 1E 00 4C 01 4C 01 BF 00 D0 00 7A 01 86 00 8B 00 AC 00 56 01 5E 01 7A 00 2B 00 7E 00 33 01 65 01 46 00 23 01 38 01 46 01 51 01 09 01 6A 01 26 00 64 01 54 01 14 00 6A 01 7D 00 1E 00 2F 01 C9 00 5A 01 85 00 15 01 85 01 CF 00 EE 00 50 01 69 00 EA 00 5A 01 54 01 47 01 03 00 6A 01 0E 00 61 00 05 00 85 00 20 00 56 01 AE 00 66 01 25 01 3C 00 36 00 20 00 50 01 7F 01 E5 00 27 00 50 01 8F 00 21 00 2C 00 2E 01 0F 00 DC 00 77 00 29 00 ED 00 38 00 61 01 91 01 D5 00 58 00 22 00 64 01 64 01 41 01 60 01 1B 00 8F 00 5E 01 93 00 6D 01 0B 00 2E 01 F9 00 9D 00 9E 00 64 01 3C 01 02 01 FC 00 58 01 53 00 21 00 4B 01 28 00 77 00 35 00 6D 01 9D 00 4D 00 A7 00 87 01 FB 00 0E 00 30 01 FC 00 68 01 86 00 FB 00 27 00 29 00 AE 00 C1 00 3D 01 7C 00 28 01 60 01 4C 01 75 00 C6 00 91 00 35 01 B4 00 9E 00 88 00 A3 00 6A 01 21 00 51 01 4D 01 7D 00 60 01 01 01 03 01 71 00 3D 01 03 01 6E 00 86 01 EF 00 FA 00 15 01 F7 00 2D 01 1E 00 55 00 6B 01 CB 00 C3 00 4B 00 C2 00 64 00 0F 00 4D 01 6F 00 4C 01 A5 00 5B 00 25 01 B1 00 B3 00 61 01 2D 01 4C 00 AF 00 BD 00 B8 00 5C 01 E8 00 47 01 75 00 C6 00 86 00 7A 00 4C 01 AD 00 80 00 7D 01 65 01 7C 00 82 01 7F 00 5B 01 7C 00 39 01 5E 01 82 00 B0 00 77 00 5E 01 0E 01 30 01 50 01 A1 00 4C 01 89 01 8A 00 1C 00 09 00 51 01 BF 00 7A 00 82 01 F7 00 51 01 2E 01 48 00 89 01 EE 00 C3 00 5B 00 53 00 31 00 21 01 67 00 B3 00 28 01 56 01 65 01 C3 00 83 00 2F 01 7B 00 5B 01 EC 00 81 00 5C 01 4F 01 BF 00 60 01 FD 00 93 00 20 01 BC 00 66 01 F6 00 A8 00 0E 01 35 01 7D 00 0E 00 5A 01 58 00 38 01 E9 00 C7 00 7B 00 66 01 55 01 A2 00 1A 00 77 00 B8 00 7A 00 AA 00 82 01 64 01 B3 00 5C 01 5B 00 25 01 2D 01 1D 01 1F 01 41 01 20 00 A1 00 32 01 A8 00 3A 00 20 00 AA 00 0E 01 F6 00 0E 00 70 00 89 01 6E 00 56 01 66 01 6C 01 54 00 70 00 06 00 0A 00 69 00 3B 00 C2 00 69 01 24 00 DB 00 F9 00 F9 00 50 01 AC 00 F9 00 7A 00 81 00 81 00 8C 01 5F 01 50 01 87 00 73 01 64 01 4F 00 80 00 86 00 39 00 76 00 E9 00 15 00 A8 00 00 01 55 01 3C 01 04 01 9D 00 4C 01 7A 00 B3 00 2B 00 7B 00 00 01 52 01 05 00 63 00 35 01 B0 00 53 01 AE 00 8D 00 56 01 C4 00 32 01 A0 00 5D 01 7C 00 44 01 7F 01 92 00 7F 01 7F 00 4D 00 18 00 51 01 8D 00 20 00 86 00 DF 00 C2 00 58 00 0E 00 6A 01 29 00 2C 01 53 00 60 01 50 01 6A 01 0E 00 85 00 8A 01 69 00 DC 00 6A 01 2D 01 38 00 81 01 1D 01 FC 00 5F 01 07 01 25 01 B5 00 83 00 F2 00 1E 00 A8 00 F3 00 48 01 53 01 34 01 3F 00 4C 01 4D 00 86 00 10 00 84 00 21 00 0E 00 20 00 DF 00 05 00 6B 01 40 01 50 01 63 00 C9 00 EE 00 02 00 F2 00 26 00 A8 00 60 01 FA 00 F0 00 21 00 A6 00 7A 01 51 01 1D 01 0E 00 D8 00 B9 00 29 01 59 00 59 00 58 00 DF 00 8A 01 84 00 8B 00 0A 00 71 01 2D 01 58 00 8C 01 64 01 DF 00 39 00 55 01 78 00 EF 00 A8 00 F7 00 93 00 87 01 18 00 7F 01 50 01 05 00 B0 00 1D 01 10 00 31 00 20 00 7F 00 54 01 83 00 6A 01 81 01 5E 00 4A 01 9C 00 6D 01 EE 00 25 01 5B 00 56 01 58 00 81 01 58 00 29 00 39 00 98 00 6F 00 82 00 61 00 55 01 3F 00 AF 00 F7 00 53 00 1E 01 6A 00 4C 00 24 01 B0 00 02 01 4A 01 8A 01 93 00 54 01 3C 01 C4 00 7C 00 2D 01 0F 00 63 00 87 01 C6 00 85 00 7D 01 0E 01 5D 00 A8 00 64 01 81 00 12 00 F0 00 BB 00 A6 00 CA 00 17 01 56 01 AC 00 76 01 82 00 F9 00 FB 00 7A 00 8E 01 62 01 7F 00 2B 00 6F 01 68 01 44 00 7F 00 4C 01 12 00 C6 00 8B 00 93 00 B1 00 41 00 39 00 F4 00 C6 00 80 00 4F 00 62 00 5B 01 5F 01 74 00 62 01 B8 00 51 01 7D 00 AA 00 F7 00 66 01 F7 00 77 00 9E 00 60 01 31 00 4A 01 24 00 8D 00 BD 00 6A 01 6B 01 52 01 D0 00 02 00 38 01 85 00 7B 00 66 01 35 00 31 00 5C 01 7A 01 F6 00 18 00 01 01 B3 00 0E 00 70 01 4D 01 4C 01 6D 01 39 01 50 01 10 00 F7 00 1E 00 B9 00 A8 00 EE 00 C4 00 62 01 10 01 81 00 29 00 25 00 31 00 55 01 52 00 E6 00 82 01 CD 00 7F 01 7C 01 B1 00 88 00 F3 00 B3 00 52 01 55 01 69 01 7F 01 47 01 7F 01 AF 00 63 00 3F 00 A8 00 4C 00 25 00 92 00 A4 00 5F 01 07 01 B0 00 7D 01 68 00 F7 00 40 01 65 00 88 00 78 00 74 00 69 00 84 00 B5 00 8A 00 03 00 5B 01 51 00 64 00 58 00 8B 00 8A 01 34 01 AF 00 29 00 54 00 48 00 F9 00 7B 01 B8 00 2D 00 AB 00 6B 00 81 00 3F 00 8D 00 32 00 21 01 CE 00 1E 00 AA 00 A2 00 7F 00 F2 00 8D 00 00 01 49 00 2D 00 24 00 B4 00 1E 00 8D 00 5C 01 BF 00 66 01 7D 01 53 00 35 01 33 01 56 01 5D 00 35 00 5D 00 2C 01 13 00 0C 01 82 01 56 01 85 00 FA 00 F7 00 29 00 38 01 82 01 77 00 5B 00 6C 01 FE 00 47 01 8B 00 FB 00 FD 00 B3 00 90 01 51 01 8D 00 6B 01 A6 00 60 01 AE 00 14 00 1E 00 69 01 05 00 C9 00 33 00 1E 01 3D 01 6D 01 AA 00 F0 00 3A 00 7F 00 12 00 64 01 09 01 4D 00 64 00 93 00 B3 00 7F 01 64 01 7D 01 77 00 A8 00 62 01 23 01 7F 01 02 01 B3 00 7C 01 D6 00 4B 01 2F 00 8A 01 32 00 B3 00 AE 00 4C 01 81 00 FA 00 80 00 7F 00 7F 00 90 00 3E 00 5A 00 81 00 71 01 E5 00 AF 00 15 00 0D 00 76 01 EE 00 F4 00 59 00 A0 00 5B 00 70 00 37 01 5D 00 73 01 57 01 6D 01 69 00 71 00 70 01 BD 00 6A 01 21 00 D5 00 F7 00 22 01 63 01 22 00 60 01 7C 00 15 00 6E 00 69 00 5C 01 9D 00 02 00 C7 00 46 01 5E 01 62 01 51 01 CF 00 0E 00 23 01 9C 00 64 01 7F 01 8A 01 5A 00 85 00 7D 01 A1 00 00 01 7F 00 3A 00 58 00 20 00 7F 00 51 01 3F 00 6A 01 63 00 85 00 01 01 81 00 82 00 F2 00 BD 00 64 00 50 01 64 00 7F 00 8D 00 81 00 EF 00 92 00 FC 00 34 01 14 00 5E 00 14 00 BD 00 CB 00 35 00 81 00 15 01 25 01 21 00 B3 00 F6 00 01 01 F1 00 3C 00 53 01 2B 00 46 00 5F 01 65 01 93 00 6D 01 51 00 26 00 83 00 48 00 43 00 69 01 6B 01 6B 00 6C 01 4F 01 0C 01 7B 00 86 00 0F 01 36 01 62 00 88 01 CC 00 62 01 F9 00 B1 00 46 00 8E 00 B3 00 80 00 21 01 81 01 91 01 65 00 7D 01 01 01 7F 01 86 00 68 00 46 00 60 01 9A 00 13 01 6D 00 EF 00 7D 01 C2 00 46 01 B8 00 37 00 EA 00 4A 01 D8 00 86 00 01 00 53 00 6A 01 8B 01 44 00 81 00 32 00 CE 00 C3 00 48 01 4D 00 25 01 25 00 66 01 5E 00 B4 00 12 00 3B 01 7F 01 2A 00 64 00 C1 00 17 01 1D 01 AA 00 AE 00 6A 01 51 01 F7 00 1B 01 57 01 20 01 10 00 13 01 8D 00 2F 01 10 00 10 00 25 01 63 00 64 00 77 00 53 00 7F 00 A2 00 50 01 EB 00 BD 00 79 01 86 00 D5 00 B0 00 64 01 61 01 4C 01 4B 00 FA 00 23 01 77 00 82 01 5C 01 36 01 63 01 61 01 50 01 6E 00 C0 00 22 00 60 01 77 00 6A 01 4C 01 49 00 0A 00 5C 01 0F 00 45 01 B0 00 BB 00 1E 01 6D 01 64 01 6A 01 51 00 32 01 53 01 8B 00 34 00 2D 01 3C 00 5B 01 51 01 A8 00 77 00 87 00 77 00 53 00 23 01 2D 01 53 01 7F 01 01 01 77 00 58 00 91 01 C2 00 F7 00 30 00 7D 01 3E 01 F7 00 20 00 51 01 89 01 51 01 06 01 3A 01 37 01 4A 00 80 00 7C 00 E0 00 DA 00 61 01 8A 01 03 01 F9 00 C6 00 D5 00 F7 00 4A 00 BD 00 C0 00 5C 00 6A 01 6A 01 38 00 5D 01 C4 00 7F 00 5B 00 3B 00 78 00 23 00 4B 00 5F 01 89 01 0F 00 55 00 50 00 02 00 A8 00 B1 00 77 01 41 01 3F 00 A0 00 47 01 58 00 58 01 BC 00 52 01 FB 00 78 01 46 00 D0 00 5E 00 4F 01 F7 00 4A 00 0B 00 44 00 24 00 81 01 84 00 3F 00 5C 01 0F 00 7C 01 6A 00 16 01 FE 00 01 01 4B 00 3E 00 82 00 16 00 C1 00 14 00 90 00 7F 01 58 00 58 00 5B 01 C3 00 97 00 4B 00 C4 00 3A 00 22 01 6B 01 64 01 32 01 8A 01 26 00 CA 00 A1 00 81 00 3F 00 34 01 5F 01 D5 00 32 01 EE 00 10 01 2F 01 9D 00 BD 00 93 00 C7 00 F0 00 25 00 90 00 AE 00 64 00 44 00 0E 00 02 01 3D 01 51 00 7D 01 20 01 4A 01 44 01 58 00 5C 00 64 00 A8 00 60 01 EE 00 A2 00 A8 00 7F 00 76 01 71 00 67 00 8A 00 85 00 59 00 64 01 F4 00 7B 01 AC 00 43 01 2B 00 1D 01 C0 00 1F 00 E0 00 15 00 36 01 8D 00 08 00 F9 00 52 00 91 00 42 01 7E 00 06 00 6A 01 7E 01 64 00 93 00 F4 00 15 00 14 00 6C 01 CB 00 37 01 41 00 2C 01 23 01 5C 01 47 01 0E 00 D5 00 EE 00 4C 00 92 00 A4 00 4F 00 69 01 25 00 80 00 D0 00 63 01 25 00 42 00 65 01 8F 00 82 01 44 00 45 00 78 00 02 01 6C 00 1B 01 42 00 7E 01 18 01 27 00 38 01 03 00 0E 01 A4 00 A1 00 3A 01 95 00 76 01 A8 00 5D 00 4D 00 37 00 B6 00 B0 00 8F 00 81 00 A3 00 FD 00 8D 00 01 00 FA 00 E3 00 0C 00 3D 00 93 00 9E 00 64 00 7E 00 EB 00 8A 00 37 01 8A 01 FC 00 8F 00 2D 01 4D 00 1E 00 2F 01 7A 00 02 00 B2 00 FA 00 53 00 BF 00 C9 00 5E 00 8A 00 CC 00 B0 00 64 01 80 00 12 00 10 00 38 01 BB 00 B8 00 68 01 8D 01 5C 01 3F 00 20 00 8B 00 F6 00 B3 00 4B 00 A2 00 F6 00 34 00 FA 00 3E 00 7E 00 89 01 64 01 1E 00 10 00 80 01 21 01 37 00 7F 01 0E 00 8A 01 C9 00 25 01 B4 00 7F 00 58 00 A3 00 93 00 09 01 7D 01 7F 00 18 01 D6 00 58 00 06 01 69 00 83 00 70 00 51 01 F4 00 43 00 77 00 68 01 88 00 6B 01 0A 00 7D 01 64 00 46 00 B3 00 01 01 26 00 2D 01 4F 00 7F 01 65 00 5A 01 B5 00 14 00 A8 00 64 00 6A 01 53 01 3C 01 50 01 C4 00 03 00 0B 00 2E 00 77 00 4D 00 30 00 BF 00 50 01 62 01 81 00 66 01 7C 01 B0 00 AC 00 83 00 88 00 6A 01 77 00 B3 00 67 00 13 00 44 00 84 00 A8 00 1D 01 A8 00 69 01 5B 00 93 00 3A 00 77 01 EA 00 82 01 5C 01 80 00 5F 01 64 01 7F 01 A4 00 50 01 37 00 53 01 1B 01 82 01 53 00 64 00 4C 01 6A 01 6A 01 3A 00 A0 00 64 01 76 00 37 00 B2 00 80 00 17 01 26 00 C9 00 08 00 7F 00 7B 00 10 00 B8 00 66 01 78 01 B1 00 65 01 28 00 08 00 A1 00 64 01 41 00 EE 00 41 00 01 01 64 01 2E 01 51 01 FF 00 88 01 0F 00 62 01 3E 01 47 00 93 00 6A 01 5E 01 8D 00 6A 01 64 01 1E 00 CC 00 09 01 85 00 BF 00 E8 00 3B 00 80 00 5E 00 94 00 AA 00 25 00 AA 00 81 00 10 00 29 00 3C 01 0E 00 8D 00 4C 00 38 00 0B 00 0A 00 B4 00 0F 00 A2 00 26 00 7C 01 FA 00 0E 01 E8 00 EE 00 5B 01 8C 00 36 00 67 00 A6 00 8A 01 22 00 2D 01 7E 00 A4 00 38 01 E5 00 B2 00 82 00 DE 00 C9 00 43 00 44 00 3A 00 AF 00 DB 00 6B 00 9D 00 05 00 FD 00 6E 00 F7 00 6F 00 84 00 5E 00 66 01 93 00 6E 00 4D 00 85 01 D9 00 BB 00 16 01 70 00 0E 01 F2 00 77 00 F9 00 00 01 7F 00 1F 00 7C 00 5E 00 C1 00 58 00 EE 00 10 01 53 01 70 00 84 00 62 00 47 00 65 01 26 00 6E 00 64 00 71 00 A8 00 69 01 05 01 77 01 00 01 AF 00 25 00 69 01 FF 00 80 00 D0 00 7F 01 2D 01 01 01 40 01 9F 00 F7 00 83 00 61 01 CA 00 21 01 7C 01 1F 01 50 01 A8 00 29 00 58 00 FA 00 FE 00 F7 00 51 01 6A 01 53 00 6B 00 6B 00 64 01 EE 00 3E 01 02 01 4A 01 A3 00 C1 00 2E 00 0C 01 CE 00 58 00 9D 00 93 00 58 00 2F 01 6A 01 69 01 B2 00 00 01 0F 00 BD 00 FD 00 05 00 BB 00 BC 00 B9 00 6B 01 51 01 26 00 38 01 E9 00 23 01 7B 00 1A 00 F0 00 38 01 51 01 54 01 80 01 7A 01 27 01 BD 00 ED 00 7C 00 E8 00 1D 01 7E 00 C1 00 20 00 AA 00 C5 00 A8 00 48 00 01 01 57 00 66 01 FE 00 52 01 23 01 82 01 6A 01 7F 00 48 00 7F 00 81 00 7B 01 8A 01 77 00 FF 00 F4 00 38 00 22 01 91 01 63 00 A8 00 2D 01 3E 01 80 00 0F 00 26 00 97 00 0E 00 53 01 60 01 02 01 7E 01 8C 00 23 01 5C 00 E6 00 1F 01 55 01 FE 00 73 01 FC 00 82 01 12 01 F9 00 47 01 0E 00 3A 00 96 00 6B 01 55 01 7D 01 9D 00 7B 00 76 00 63 00 53 00 A8 00 0E 00 26 00 30 01 C5 00 47 00 B3 00 49 00 69 00 41 00 70 01 3E 00 14 00 A1 00 81 01 6A 01 6A 01 27 00 51 01 D9 00 E0 00 2B 00 1D 01 64 01 0E 00 80 01 08 00 52 00 5E 00 B3 00 82 01 73 01 51 01 1F 01 4C 01 C1 00 24 01 1A 00 27 00 C1 00 FD 00 D8 00 80 00 00 01 1B 01 0E 00 3F 00 FA 00 34 01 84 00 38 01 51 01 53 01 C2 00 06 00 A8 00 3E 01 51 01 8A 01 18 00 AE 00 8B 01 15 01 76 00 70 01 30 00 5B 01 0D 01 00 01 82 00 60 00 7F 00 64 01 AF 00 51 01 82 01 53 00 81 00 EF 00 71 00 64 01 C2 00 7F 01 F7 00 FE 00 69 01 3C 00 58 00 01 01 88 00 8D 00 AD 00 8A 01 70 01 CE 00 7C 01 82 00 26 00 44 00 5B 00 81 01 64 01 64 00 33 00 47 01 53 01 C7 00 7F 01 60 01 23 01 25 00 43 01 A6 00 9E 00 EB 00 77 00 3C 01 5B 01 6D 00 38 01 A4 00 15 00 83 00 51 01 8D 00 A8 00 5E 01 23 01 37 00 4B 00 FF 00 5D 01 33 00 11 00 14 00 35 01 81 00 58 00 FA 00 7F 01 58 00 1D 01 A8 00 47 01 80 00 14 00 36 01 9D 00 FB 00 0E 00 53 01 53 01 7F 00 83 00 AB 00 7F 00 2F 00 79 00 26 00 7F 01 43 00 14 00 7F 01 81 00 43 00 2A 00 80 01 8D 00 4C 00 37 00 EF 00 0D 01 D9 00 E8 00 F7 00 29 00 8B 00 F6 00 51 00 33 00 82 01 AE 00 20 00 AD 00 8E 01 56 01 7F 01 42 00 C9 00 5A 01 C9 00 EE 00 77 00 8B 00 1E 01 64 00 8F 01 62 00 30 01 7F 01 8A 01 FE 00 86 00 6A 01 A8 00 4D 01 40 01 7F 00 EB 00 53 00 1B 01 65 01 02 00 15 01 BA 00 24 00 8D 00 0A 00 3E 01 8A 01 94 00 6A 01 2F 00 4F 01 C6 00 6B 01 47 01 35 00 33 01 8A 00 8D 00 B8 00 01 01 28 00 FF 00 B5 00 50 01 70 01 CA 00 05 00 B0 00 0B 00 57 01 69 01 52 00 06 00 F3 00 D6 00 B3 00 30 01 58 00 76 00 36 01 69 00 84 00 4C 01 4F 00 7F 00 83 00 54 01 5E 01 61 00 A8 00 AA 00 81 00 23 01 3E 01 6A 00 1B 01 7A 00 7F 00 FE 00 AF 00 8C 01 53 00 9E 00 21 00 64 00 D5 00 D6 00 42 00 23 01 8A 01 54 00 43 00 4D 00 00 01 58 00 7B 00 0F 00 17 01 05 00 F7 00 35 01 67 00 62 01 A5 00 10 00 5D 01 BB 00 C6 00 68 01 69 00 1D 01 90 01 A8 00 38 00 61 01 38 00 FB 00 BB 00 81 00 8D 00 0D 01 63 00 0B 00 84 00 42 01 98 00 64 00 3F 00 76 00 5E 00 93 00 0E 00 B2 00 F8 00 9B 00 12 00 48 00 BF 00 06 00 60 01 AB 00 55 01 4B 01 26 00 54 01 60 01 3F 01 39 01 68 01 10 00 9E 00 BD 00 05 01 3E 01 7F 00 8A 01 5A 01 02 01 88 00 12 00 7A 00 AD 00 C9 00 7C 00 C2 00 7F 00 8C 00 82 01 C2 00 F7 00 05 00 20 01 AE 00 39 00 29 00 69 01 52 01 64 01 01 01 48 00 A8 00 FE 00 18 00 03 00 54 00 69 01 50 01 60 01 51 01 00 01 6E 00 77 01";
            byte[] bytes = Encoding.Default.GetBytes(StrInput);
            byte[] buffer2 = Encoding.Default.GetBytes(StrInput);
            for (int i = 0; i <= (bytes.Length - 1); i++)
            {
                bytes[i] = (byte) (bytes[i] - 160);
            }
            byte[] buffer3 = Leey.Net.eTerm.Command.StringToBytes(s);
            byte[] buffer4 = Leey.Net.eTerm.Command.StringToBytes(str2);
            byte[] buffer5 = Leey.Net.eTerm.Command.StringToBytes(str3);
            string str4 = "";
            for (short j = 0; j <= ((bytes.Length / 2) - 1); j = (short) (j + 1))
            {
                int num4;
                int num3 = ((buffer2[j * 2] * 0x5e) + buffer2[(j * 2) + 1]) - 0x3bbe;
                if ((num3 < 0x1433) || (num3 > 0x2178))
                {
                    int num5 = (Convert.ToInt16(bytes[j * 2]) << 8) + Convert.ToInt16(bytes[(j * 2) + 1]);
                    num4 = 0;
                    while (num4 <= ((buffer3.Length / 2) - 1))
                    {
                        if (((Convert.ToInt16(buffer3[(num4 * 2) + 1]) << 8) + Convert.ToInt16(buffer3[num4 * 2])) >= num5)
                        {
                            break;
                        }
                        num4++;
                    }
                }
                else
                {
                    num4 = ((Convert.ToInt16(buffer5[((num3 * 2) - 0x2222) + 1]) << 8) + Convert.ToInt16(buffer5[(num3 * 2) - 0x2222])) - 1;
                }
                if (num4 < 0x191)
                {
                    str4 = str4 + Encoding.Default.GetString(buffer4, num4 * 7, 7).Trim();
                }
                else
                {
                    str4 = "";
                }
            }
            return str4;
        }

        private static string ReplaceCC(Match m)
        {
            return (GetPinYin(m.Groups[1].ToString()) + EncodeGB2312(m.Groups[1].ToString()));
        }

        private static unsafe void sub_004078EE(byte* a, byte* b, byte[] c)
        {
            byte[] buffer = new byte[0x40];
            byte[] buffer2 = new byte[8];
            byte[] buffer3 = new byte[0x40];
            byte[] buffer4 = new byte[0x40];
            byte[] buffer5 = new byte[0x30];
            byte[] buffer6 = new byte[0x30];
            byte[] buffer7 = new byte[0x30];
            byte[] buffer8 = new byte[0x20];
            byte[] buffer9 = new byte[0x20];
            byte[] buffer10 = new byte[0x20];
            byte[] buffer11 = new byte[0x40];
            fixed (byte* numRef = buffer4)
            {
                sub_00407B1A(c, buffer);
                copy(buffer2, a, 8);
                sub_00407A3B(buffer2, buffer3);
                sub_00407AB4(buffer3, buffer4);
                for (int i = 0; i < 0x10; i++)
                {
                    sub_00407B9D(buffer, i);
                    sub_00407C4D(buffer, buffer5);
                    sub_00407AF9(buffer4, buffer6);
                    sub_00407C71(buffer5, buffer6, buffer7);
                    sub_00407C97(buffer7, buffer8);
                    sub_00407D0A(buffer8, buffer9);
                    sub_00407D2E(buffer4, buffer9, buffer10);
                    if (i != 15)
                    {
                        sub_00407D54(numRef + 0x20, buffer4);
                        sub_00407D54(buffer10, numRef + 0x20);
                    }
                    else
                    {
                        sub_00407D54(buffer10, buffer4);
                    }
                }
                sub_00407AD5(buffer4, buffer11);
                sub_00407A76(buffer11, buffer2);
                copy(b, buffer2, 8);
            }
        }

        private static void sub_00407A3B(byte[] a, byte[] b)
        {
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    b[j + (i * 8)] = Convert.ToByte((int) ((a[i] >> (7 - j)) & 1));
                }
            }
        }

        private static void sub_00407A76(byte[] a, byte[] b)
        {
            int num = 0;
            for (int i = 0; i < 8; i++)
            {
                int num3 = a[i * 8];
                for (int j = 1; j < 8; j++)
                {
                    num3 = num3 << 1;
                    num3 += a[j + (i * 8)];
                }
                b[num++] = Convert.ToByte(num3);
            }
        }

        private static void sub_00407AB4(byte[] a, byte[] b)
        {
            string s = "A0 48 43 00 3A 32 2A 22 1A 12 0A 2 3C 34 2C 24 1C 14 0C 4 3E 36 2E 26 1E 16 0E 6 40 38 30 28 20 18 10 8 39 31 29 21 19 11 9 1 3B 33 2B 23 1B 13 0B 3 3D 35 2D 25 1D 15 0D 5 3F 37 2F 27 1F 17 0F 7";
            byte[] buffer = Leey.Net.eTerm.Command.StringToBytes(s);
            for (int i = 0; i < 0x40; i++)
            {
                b[i] = a[buffer[i + 4] - 1];
            }
        }

        private static void sub_00407AD5(byte[] a, byte[] b)
        {
            string s = "28 08 30 10 38 18 40 20 27 07 2F 0F 37 17 3F 1F 26 06 2E 0E 36 16 3E 1E 25 05 2D 0D 35 15 3D 1D 24 04 2C 0C 34 14 3C 1C 23 03 2B 0B 33 13 3B 1B 22 02 2A 0A 32 12 3A 1A 21 01 29 09 31 11 39 19";
            byte[] buffer = Leey.Net.eTerm.Command.StringToBytes(s);
            for (int i = 0; i < 0x40; i++)
            {
                b[i] = a[buffer[i] - 1];
            }
        }

        private static void sub_00407AF9(byte[] a, byte[] b)
        {
            string s = "20 1 2 3 4 5 4 5 6 7 8 9 8 9 0A 0B 0C 0D 0C 0D 0E 0F 10 11 10 11 12 13 14 15 14 15 16 17 18 19 18 19 1A 1B 1C 1D 1C 1D 1E 1F 20 1";
            byte[] buffer = Leey.Net.eTerm.Command.StringToBytes(s);
            for (int i = 0; i < 0x30; i++)
            {
                b[i] = a[(buffer[i] - 1) + 0x20];
            }
        }

        private static void sub_00407B1A(byte[] a, byte[] b)
        {
            int num;
            int num2;
            string s = "39 31 29 21 19 11 9 1 3A 32 2A 22 1A 12 0A 2 3B 33 2B 23 1B 13 0B 3 3C 34 2C 24 3F 37 2F 27 1F 17 0F 7 3E 36 2E 26 1E 16 0E 6 3D 35 2D 25 1D 15 0D 5 1C 14 0C 4";
            byte[] buffer = Leey.Net.eTerm.Command.StringToBytes(s);
            byte[] buffer2 = new byte[0x38];
            byte[] buffer3 = new byte[0x40];
            for (num = 0; num < 7; num++)
            {
                num2 = 0;
                while (num2 < 8)
                {
                    buffer2[num2 + (num * 8)] = Convert.ToByte((int) ((a[num] >> (7 - num2)) & 1));
                    num2++;
                }
            }
            for (num = 0; num < 8; num++)
            {
                for (num2 = 0; num2 < 7; num2++)
                {
                    buffer3[num2 + (num * 8)] = buffer2[num2 + (num * 7)];
                }
            }
            int num3 = 0;
            for (num = 0; num < 0x38; num++)
            {
                b[num3++] = buffer3[buffer[num] - 1];
            }
        }

        private static void sub_00407B9D(byte[] a, int index)
        {
            int num4;
            string s = "01 01 02 02 02 02 02 02 01 02 02 02 02 02 02 01";
            byte num = Leey.Net.eTerm.Command.StringToBytes(s)[index];
            byte[] buffer2 = new byte[2];
            int num2 = -1;
            if (num > 0)
            {
                num2 = 0;
                while (num2 < (num & 3))
                {
                    buffer2[num2] = a[num2];
                    num2++;
                }
            }
            int num3 = 0x1c;
            for (num4 = num2; num4 < num3; num4++)
            {
                a[num4 - num2] = a[num4];
            }
            for (num4 = 0; num4 < num2; num4++)
            {
                a[(num3 - num2) + num4] = buffer2[num4];
            }
            if (num > 0)
            {
                num2 = 0;
                while (num2 < (num & 3))
                {
                    buffer2[num2] = a[num2 + num3];
                    num2++;
                }
            }
            num4 = num2;
            while (num4 < num3)
            {
                a[(num4 - num2) + num3] = a[num4 + num3];
                num4++;
            }
            for (num4 = 0; num4 < num2; num4++)
            {
                a[((num3 - num2) + num4) + num3] = buffer2[num4];
            }
        }

        private static void sub_00407C4D(byte[] a, byte[] b)
        {
            string s = "0E 11 0B 18 1 5 3 1C 0F 6 15 0A 17 13 0C 4 1A 8 10 7 1B 14 0D 2 29 34 1F 25 2F 37 1E 28 33 2D 21 30 2C 31 27 38 22 35 2E 2A 32 24 1D 20";
            byte[] buffer = Leey.Net.eTerm.Command.StringToBytes(s);
            for (int i = 0; i < 0x30; i++)
            {
                b[i] = a[buffer[i] - 1];
            }
        }

        private static void sub_00407C71(byte[] a, byte[] b, byte[] c)
        {
            for (int i = 0; i < 0x30; i++)
            {
                c[i] = Convert.ToByte((int) (a[i] ^ b[i]));
            }
        }

        private static void sub_00407C97(byte[] a, byte[] b)
        {
            string s = "0E 04 0D 01 02 0F 0B 08 03 0A 06 0C 05 09 00 07 00 0F 07 04 0E 02 0D 01 0A 06 0C 0B 09 05 03 08 04 01 0E 08 0D 06 02 0B 0F 0C 09 07 03 0A 05 00 0F 0C 08 02 04 09 01 07 05 0B 03 0E 0A 00 06 0D 0F 01 08 0E 06 0B 03 04 09 07 02 0D 0C 00 05 0A 03 0D 04 07 0F 02 08 0E 0C 00 01 0A 06 09 0B 05 00 0E 07 0B 0A 04 0D 01 05 08 0C 06 09 03 02 0F 0D 08 0A 01 03 0F 04 02 0B 06 07 0C 00 05 0E 09 0A 00 09 0E 06 03 0F 05 01 0D 0C 07 0B 04 02 08 0D 07 00 09 03 04 06 0A 02 08 05 0E 0C 0B 0F 01 0D 06 04 09 08 0F 03 00 0B 01 02 0C 05 0A 0E 07 01 0A 0D 00 06 09 08 07 04 0F 0E 03 0B 05 02 0C 07 0D 0E 03 00 06 09 0A 01 02 08 05 0B 0C 04 0F 0D 08 0B 05 06 0F 00 03 04 07 02 0C 01 0A 0E 09 0A 06 09 00 0C 0B 07 0D 0F 01 03 0E 05 02 08 04 03 0F 00 06 0A 01 0D 08 09 04 05 0B 0C 07 02 0E 02 0C 04 01 07 0A 0B 06 08 05 03 0F 0D 00 0E 09 0E 0B 02 0C 04 07 0D 01 05 00 0F 0A 03 09 08 06 04 02 01 0B 0A 0D 07 08 0F 09 0C 05 06 03 00 0E 0B 08 0C 07 01 0E 02 0D 06 0F 00 09 0A 04 05 03 0C 01 0A 0F 09 02 06 08 00 0D 03 04 0E 07 05 0B 0A 0F 04 02 07 0C 09 05 06 01 0D 0E 00 0B 03 08 09 0E 0F 05 02 08 0C 03 07 00 04 0A 01 0D 0B 06 04 03 02 0C 09 05 0F 0A 0B 0E 01 07 06 00 08 0D 04 0B 02 0E 0F 00 08 0D 03 0C 09 07 05 0A 06 01 0D 00 0B 07 04 09 01 0A 0E 03 05 0C 02 0F 08 06 01 04 0B 0D 0C 03 07 0E 0A 0F 06 08 00 05 09 02 06 0B 0D 08 01 04 0A 07 09 05 00 0F 0E 02 03 0C 0D 02 08 04 06 0F 0B 01 0A 09 03 0E 05 00 0C 07 01 0F 0D 08 0A 03 07 04 0C 05 06 0B 00 0E 09 02 07 0B 04 01 09 0C 0E 02 00 06 0A 0D 0F 03 05 08 02 01 0E 07 04 0A 08 0D 0F 0C 09 00 03 05 06 0B";
            byte[] buffer = Leey.Net.eTerm.Command.StringToBytes(s);
            for (int i = 0; i < 8; i++)
            {
                byte num2 = Convert.ToByte((int) (a[i * 6] + (2 * i)));
                byte num3 = a[5 + (i * 6)];
                int num4 = 1;
                while (num4 < 4)
                {
                    num2 = Convert.ToByte((int) (num3 + (2 * num2)));
                    num3 = a[num4 + (i * 6)];
                    num4++;
                }
                num2 = Convert.ToByte((int) (num3 + (2 * num2)));
                byte num5 = buffer[a[4 + (i * 6)] + (2 * num2)];
                for (num4 = 0; num4 < 4; num4++)
                {
                    b[num4 + (i * 4)] = Convert.ToByte((int) ((num5 >> (3 - num4)) & 1));
                }
            }
        }

        private static void sub_00407D0A(byte[] a, byte[] b)
        {
            string s = "10 7 14 15 1D 0C 1C 11 1 0F 17 1A 5 12 1F 0A 2 8 18 0E 20 1B 3 9 13 0D 1E 6 16 0B 4 19";
            byte[] buffer = Leey.Net.eTerm.Command.StringToBytes(s);
            for (int i = 0; i < 0x20; i++)
            {
                b[i] = a[buffer[i] - 1];
            }
        }

        private static void sub_00407D2E(byte[] a, byte[] b, byte[] c)
        {
            for (int i = 0; i < 0x20; i++)
            {
                c[i] = Convert.ToByte((int) (a[i] ^ b[i]));
            }
        }

        private static void sub_00407D54(byte[] a, byte[] b)
        {
            for (int i = 0; i < 0x20; i++)
            {
                b[i] = a[i];
            }
        }

        private static unsafe void sub_00407D54(byte[] a, byte* b)
        {
            for (int i = 0; i < 0x20; i++)
            {
                b++;
                b[0] = a[i];
            }
        }

        private static unsafe void sub_00407D54(byte* a, byte[] b)
        {
            for (int i = 0; i < 0x20; i++)
            {
                a++;
                b[i] = a[0];
            }
        }
    }
}
